import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    menus: [],
    adminInfo: {
      avatarUrl: '',
      nickName: '',
    },
    pageHeader: ''
  },
  mutations: {
    initMenu(state, menus) {
      state.menus = menus
    },
    initAdminInfo(state, adminInfo) {
      state.adminInfo = adminInfo
    },
    clearState(state) {
      state.menus = []
      state.adminInfo = {}
    },
    initPageHeader(state, to) {
      state.pageHeader = to.name
    }
  },
  actions: {
  },
  modules: {
  }
})
